<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jQuery封装的jsonp</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
</head>
<body>
<h3>jQuery封装的jsonp</h3>
<button id="btn">点我获取数据</button>
<script type="text/javascript">
    const btn = $('#btn')
    btn.click(() => {
        $.getJSON('http://localhost:8080/test_jsonp?callback=?', {}, (data) => {
            console.log(data)
        })
    })
</script>
</body>
</html>
